home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1999 Spring / macformat-077.iso / Shareware Plus / Development / Akua Sweets 131 / Akua Sweets Examples / File / SimpleText ReadOnly Toggle < prev    next >
Encoding:
Text File  |  1999-03-04  |  972 b   |  47 lines  |  [TEXT/ToyS]

  1. global gasFolders
  2.  
  3.  
  4. on open fsObjs
  5.     set gasFolders to {}
  6.     repeat with fsObj in fsObjs
  7.         DoItem(fsObj)
  8.     end repeat
  9.     
  10.     repeat while gasFolders is not {}
  11.         set foldObj to item 1 of gasFolders
  12.         set gasFolders to edit list gasFolders with edits {-1}
  13.         DoFolder(foldObj)
  14.     end repeat
  15. end open
  16.  
  17.  
  18. on DoFolder(foldObj)
  19.     -- Do files
  20.     set foldPath to foldObj as string
  21.     set fItems to the entries in foldObj whose kinds are a file
  22.     repeat with fItem in fItems
  23.         DoOne((foldPath & fItem) as alias)
  24.     end repeat
  25. end DoFolder
  26.  
  27.  
  28. on DoItem(fsObj)
  29.     set bi to basic info for fsObj
  30.     if (catalog kind of bi) is a folder then
  31.         set gasFolders to gasFolders & {fsObj}
  32.     else
  33.         DoFile(fsObj, bi)
  34.     end if
  35. end DoItem
  36.  
  37.  
  38. on DoFile(fsObj, info)
  39.     if (system type of info) is "ttro" then
  40.         set system type of info to "TEXT"
  41.         set the catalog info of fsObj to info
  42.     else if (system type of info) is "TEXT" then
  43.         set system type of info to "ttro"
  44.         set the catalog info of fsObj to info
  45.     end if
  46. end DoFile
  47.